/*
 *说明：单位信息表 明细页面脚本
 *
 *@author lx 2010-08-11
*/

var opeForm;

$(function() {
	
	var usr_id = $('#usr_id').val();
	
	//alert(usr_id);

	// 选中上次最后一次选中的tab页签
	if (isNotEmpty(parent.selectedTab)) {
		$("div[title=" + parent.selectedTab + "]").attr('selected', 'true');
	}else{
		$("div[title=所属用户组访问权限]").attr('selected', 'true');
	}
	
	$('#layout').layout();
	$('#tt').tabs({
		onSelect : function(title){
			parent.selectedTab = title;	//记录当前选中的tab页签 
			
			if (title == '所属用户组访问权限') {
				if (!isEmpty($('#usrgrpAuthRscFrame').attr('src'))) {
					return;
				}
				
				if (isEmpty(usr_id)) {
					return;
				}
				$('#usrgrpAuthRscFrame').attr('src','D_ACL!showUsrBelongUsrgrpSelectedAuthRsc.do?model.auth_obj_id=' +usr_id);
			}   
			if (title == '用户新增访问权限') {
				if (!isEmpty($('#usrAddedAuthRscFrame').attr('src'))) {
					return;
				}
				
				if (isEmpty(usr_id)) {
					return;
				}
				$('#usrAddedAuthRscFrame').attr('src','D_ACL!showUsrSelectedAuthRsc.do?model.auth_obj_id=' +usr_id);
			} 
			if (title == '用户认证权限') {
				if (!isEmpty($('#usrAddAccessRscFrame').attr('src'))) {
					return;
				}
				
				if (isEmpty(usr_id)) {
					return;
				}
				$('#usrAddAccessRscFrame').attr('src','D_TIME_POLICY!showUsrSelectedTimePolicy.do?model.usr_id=' +usr_id);
			}			
		}
	});
});